<?php
declare (strict_types = 1);

namespace app\admin\validate;

use think\Validate;

class AuthUpdate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'auth_name' => 'require',
        'is_nav' => 'require|Number',
        'pid' => 'require|Number',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'auth_name.require' => '权限名称不能为空',
        'is_nav.require' => '必须选择是否为菜单',
        'is_nav.Number' => '菜单选项传参错误',
        'pid.require' => '上级权限必须选择',
        'pid.Number' => '上级菜单传参错误',
    ];
}
